#pragma once

#include <d3dx9.h>
#include "DirectInput.h"

class CCamera
{
public:
	CCamera(void);
	virtual ~CCamera(void);

	/* singleton GetInstance */ 
	static CCamera* GetInstance()
	{
		if(!s_pCamera)
		{
			s_pCamera = new CCamera();
		}
		return s_pCamera;
	}

	void Update(float dt);

	/* get methods */
	D3DXMATRIX GetViewMatrix();
	D3DXMATRIX GetProjMatrix();	
	D3DXVECTOR3 GetEyePos() { return mEyePos; }

	/* rebuild matrix */
	void BuildViewMtx();
	void BuildProjMtx();

private:
	/* singleton */
	static CCamera* s_pCamera;

	/* camera's matrices */
	D3DXMATRIX mView;
	D3DXMATRIX mProj;

	/* camera's properties */
	D3DXVECTOR3 mEyePos;
	D3DXVECTOR3 mUp; // up vector
	D3DXVECTOR3 mLookAt; // lookat vector

	// others
	float mCameraRadius;
	float mCameraHeight;
	float mCameraRotationY;
		
};
